/*******************************************************************************
 * Size: 24 px
 * Bpp: 2
 * Opts: 
 ******************************************************************************/
#include "lvgl.h"

#ifndef FONT_WEATHER_NUM_24
#define FONT_WEATHER_NUM_24 1
#endif

#if FONT_WEATHER_NUM_24

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+002D "-" */
    0x55, 0x53, 0xff, 0xc0,

    /* U+002E "." */
    0x0, 0x2d, 0x3e, 0x2c,

    /* U+002F "/" */
    0x0, 0x2, 0xc0, 0x0, 0x38, 0x0, 0x3, 0x40,
    0x0, 0x70, 0x0, 0xe, 0x0, 0x0, 0xd0, 0x0,
    0x1c, 0x0, 0x3, 0x80, 0x0, 0x34, 0x0, 0x7,
    0x0, 0x0, 0xe0, 0x0, 0xd, 0x0, 0x1, 0xc0,
    0x0, 0x38, 0x0, 0x3, 0x40, 0x0, 0x70, 0x0,
    0xe, 0x0, 0x0, 0xd0, 0x0, 0x1c, 0x0, 0x2,
    0x80, 0x0, 0x34, 0x0, 0x7, 0x0, 0x0, 0x50,
    0x0, 0x0,

    /* U+0030 "0" */
    0x2, 0xfe, 0x0, 0x3f, 0xbf, 0x2, 0xe0, 0x2e,
    0xf, 0x0, 0x3c, 0x78, 0x0, 0x7a, 0xd0, 0x0,
    0xeb, 0x40, 0x3, 0xfc, 0x0, 0xf, 0xf0, 0x0,
    0x3e, 0xc0, 0x0, 0xfb, 0x40, 0x3, 0xed, 0x0,
    0xe, 0x78, 0x0, 0x74, 0xf0, 0x3, 0xc2, 0xe0,
    0x2e, 0x3, 0xfb, 0xf0, 0x2, 0xfe, 0x0,

    /* U+0031 "1" */
    0x2, 0xf0, 0x3, 0xff, 0x0, 0x15, 0xf0, 0x0,
    0xf, 0x0, 0x0, 0xf0, 0x0, 0xf, 0x0, 0x0,
    0xf0, 0x0, 0xf, 0x0, 0x0, 0xf0, 0x0, 0xf,
    0x0, 0x0, 0xf0, 0x0, 0xf, 0x0, 0x0, 0xf0,
    0x0, 0xf, 0x0, 0x0, 0xf0, 0xa, 0xaf, 0xa9,
    0xff, 0xff, 0xe0,

    /* U+0032 "2" */
    0x1, 0xff, 0x40, 0xb, 0xeb, 0xf0, 0x2d, 0x0,
    0xb8, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x3c, 0x0,
    0x0, 0x3c, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x78,
    0x0, 0x0, 0xf0, 0x0, 0x2, 0xd0, 0x0, 0x7,
    0xc0, 0x0, 0x1f, 0x0, 0x0, 0x3c, 0x0, 0x1,
    0xf0, 0x0, 0x7, 0xc0, 0x0, 0x2f, 0xaa, 0xaa,
    0x3f, 0xff, 0xff,

    /* U+0033 "3" */
    0x1, 0xbf, 0x80, 0xf, 0xeb, 0xf0, 0xd, 0x0,
    0x7c, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x3c, 0x0,
    0x0, 0x7c, 0x0, 0x2, 0xf0, 0x0, 0xbf, 0x80,
    0x0, 0x6b, 0xe0, 0x0, 0x0, 0xbc, 0x0, 0x0,
    0x2d, 0x0, 0x0, 0x1e, 0x0, 0x0, 0xe, 0x10,
    0x0, 0x2e, 0x3d, 0x0, 0x7c, 0x1f, 0xeb, 0xf4,
    0x1, 0xff, 0x80,

    /* U+0034 "4" */
    0x0, 0x1, 0xf0, 0x0, 0x0, 0xfc, 0x0, 0x0,
    0xff, 0x0, 0x0, 0xb7, 0xc0, 0x0, 0x3c, 0xf0,
    0x0, 0x3c, 0x3c, 0x0, 0x2d, 0xf, 0x0, 0x1e,
    0x3, 0xc0, 0xf, 0x0, 0xf0, 0xb, 0x40, 0x3c,
    0x7, 0xea, 0xaf, 0xa2, 0xff, 0xff, 0xfd, 0x0,
    0x0, 0xf0, 0x0, 0x0, 0x3c, 0x0, 0x0, 0xf,
    0x0, 0x0, 0x3, 0xc0, 0x0, 0x0, 0xf0, 0x0,

    /* U+0035 "5" */
    0x7, 0xff, 0xfc, 0x7, 0xea, 0xa8, 0xb, 0x40,
    0x0, 0xb, 0x0, 0x0, 0xb, 0x0, 0x0, 0xf,
    0x0, 0x0, 0xf, 0xbf, 0xd0, 0xf, 0x96, 0xf8,
    0x0, 0x0, 0x3c, 0x0, 0x0, 0x1e, 0x0, 0x0,
    0xe, 0x0, 0x0, 0xf, 0x0, 0x0, 0x1e, 0x0,
    0x0, 0x2d, 0x3c, 0x0, 0xbc, 0x1f, 0xeb, 0xf0,
    0x2, 0xff, 0x40,

    /* U+0036 "6" */
    0x0, 0xbf, 0x90, 0x3, 0xfa, 0xf4, 0xf, 0x40,
    0x10, 0x2d, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x78,
    0x0, 0x0, 0x74, 0xbf, 0x80, 0xbb, 0x96, 0xf0,
    0xbd, 0x0, 0xb8, 0xb4, 0x0, 0x3c, 0x74, 0x0,
    0x3c, 0x78, 0x0, 0x3c, 0x3c, 0x0, 0x3c, 0x2c,
    0x0, 0x38, 0xf, 0x0, 0xf0, 0x7, 0xeb, 0xd0,
    0x1, 0xbe, 0x40,

    /* U+0037 "7" */
    0xff, 0xff, 0xfc, 0xaa, 0xaa, 0xfc, 0x0, 0x0,
    0xb0, 0x0, 0x1, 0xd0, 0x0, 0x3, 0x80, 0x0,
    0xb, 0x40, 0x0, 0xf, 0x0, 0x0, 0x1d, 0x0,
    0x0, 0x3c, 0x0, 0x0, 0x3c, 0x0, 0x0, 0x78,
    0x0, 0x0, 0xb4, 0x0, 0x0, 0xf0, 0x0, 0x0,
    0xf0, 0x0, 0x0, 0xf0, 0x0, 0x0, 0xf0, 0x0,
    0x0, 0xf0, 0x0,

    /* U+0038 "8" */
    0x2, 0xfe, 0x0, 0xf, 0xab, 0xd0, 0x2d, 0x0,
    0xf0, 0x3c, 0x0, 0x74, 0x3c, 0x0, 0x74, 0x3c,
    0x0, 0x70, 0xf, 0x0, 0xf0, 0x3, 0xd2, 0xc0,
    0x7, 0xff, 0x40, 0x2d, 0x7, 0xd0, 0x74, 0x0,
    0xf4, 0xb0, 0x0, 0x3c, 0xf0, 0x0, 0x3c, 0xb0,
    0x0, 0x3c, 0x7c, 0x0, 0xb8, 0x2f, 0x9b, 0xe0,
    0x2, 0xfe, 0x40,

    /* U+0039 "9" */
    0x2, 0xf9, 0x0, 0x7e, 0xbe, 0x3, 0xc0, 0x2d,
    0x2d, 0x0, 0x3c, 0xf0, 0x0, 0x77, 0xc0, 0x0,
    0xeb, 0x0, 0x3, 0xae, 0x0, 0x2f, 0x3e, 0x7,
    0xbc, 0x2f, 0xf4, 0xf0, 0x0, 0x3, 0x80, 0x0,
    0x1d, 0x0, 0x0, 0xf0, 0x0, 0x7, 0xc2, 0x0,
    0x7c, 0x1f, 0xef, 0xd0, 0xb, 0xf8, 0x0,

    /* U+003A ":" */
    0x2c, 0x3e, 0x2d, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x2d, 0x3e, 0x2c,

    /* U+2103 "℃" */
    0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0xfe, 0x0,
    0x0, 0x6e, 0x80, 0x70, 0x34, 0x0, 0xbf, 0xff,
    0x4a, 0x2, 0x80, 0x2f, 0x90, 0x7c, 0xa0, 0x28,
    0xb, 0xc0, 0x0, 0x7, 0x3, 0x40, 0xf4, 0x0,
    0x0, 0x2f, 0xe0, 0x1f, 0x0, 0x0, 0x0, 0x10,
    0x2, 0xd0, 0x0, 0x0, 0x0, 0x0, 0x3d, 0x0,
    0x0, 0x0, 0x0, 0x3, 0xc0, 0x0, 0x0, 0x0,
    0x0, 0x3c, 0x0, 0x0, 0x0, 0x0, 0x3, 0xd0,
    0x0, 0x0, 0x0, 0x0, 0x3d, 0x0, 0x0, 0x0,
    0x0, 0x2, 0xe0, 0x0, 0x0, 0x0, 0x0, 0xf,
    0x0, 0x0, 0x0, 0x0, 0x0, 0xfc, 0x0, 0x4,
    0x0, 0x0, 0x3, 0xf0, 0x2, 0xe0, 0x0, 0x0,
    0xf, 0xfb, 0xfc, 0x0, 0x0, 0x0, 0x1f, 0xfd,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 132, .box_w = 7, .box_h = 2, .ofs_x = 1, .ofs_y = 6},
    {.bitmap_index = 4, .adv_w = 104, .box_w = 4, .box_h = 4, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 8, .adv_w = 151, .box_w = 10, .box_h = 23, .ofs_x = 0, .ofs_y = -5},
    {.bitmap_index = 66, .adv_w = 211, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 113, .adv_w = 211, .box_w = 10, .box_h = 17, .ofs_x = 2, .ofs_y = 0},
    {.bitmap_index = 156, .adv_w = 211, .box_w = 12, .box_h = 17, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 207, .adv_w = 211, .box_w = 12, .box_h = 17, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 258, .adv_w = 211, .box_w = 13, .box_h = 17, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 314, .adv_w = 211, .box_w = 12, .box_h = 17, .ofs_x = 0, .ofs_y = 0},
    {.bitmap_index = 365, .adv_w = 211, .box_w = 12, .box_h = 17, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 416, .adv_w = 211, .box_w = 12, .box_h = 17, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 467, .adv_w = 211, .box_w = 12, .box_h = 17, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 518, .adv_w = 211, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 565, .adv_w = 104, .box_w = 4, .box_h = 13, .ofs_x = 1, .ofs_y = 0},
    {.bitmap_index = 578, .adv_w = 384, .box_w = 22, .box_h = 20, .ofs_x = 1, .ofs_y = -1}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/



/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 45, .range_length = 14, .glyph_id_start = 1,
        .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
    },
    {
        .range_start = 8451, .range_length = 1, .glyph_id_start = 15,
        .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
    }
};



/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = NULL,
    .kern_scale = 0,
    .cmap_num = 2,
    .bpp = 2,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
    .cache = &cache
#endif
};


/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t font_weather_num_24 = {
#else
lv_font_t font_weather_num_24 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 24,          /*The maximum line height required by the font*/
    .base_line = 5,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -3,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};



#endif /*#if FONT_WEATHER_NUM_24*/

